//
//  PMPolygonShape.h
//  PezMonkey
//
//  Created by Spence DiNicolantonio on 10/29/09.
//  Copyright 2009 Necrosoft. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "PMCore.h"
#import "PMShape.h"


@interface PMPolygonShape : PMShape {

}

// Property definitions of getters/setters for data members stored by backend 
// Chipmunk structure. These properties are not synthesized, because their 
// implementations are given explicitly.
@property (assign, readonly) NSUInteger vertCount;
@property (assign, readonly) PMVect *vertices;


#pragma mark -
#pragma mark Init
- (id)initWithBody:(PMBody *)aBody vertices:(PMVect[])vertices vertCount:(NSUInteger)vertCount;
- (id)initWithBody:(PMBody *)aBody vertices:(PMVect[])vertices vertCount:(NSUInteger)vertCount center:(PMVect)center;

#pragma mark Convenience
+ (PMPolygonShape *)polygonShapeWithBody:(PMBody *)aBody vertices:(PMVect[])vertices vertCount:(NSUInteger)vertCount;
+ (PMPolygonShape *)polygonShapeWithBody:(PMBody *)aBody vertices:(PMVect[])vertices vertCount:(NSUInteger)vertCount center:(PMVect)center;


#pragma mark -
#pragma mark Getters
- (PMVect)vertexAtIndex:(NSInteger)index;


#pragma mark -
#pragma mark Setters
- (void)setVertices:(PMVect[])vertices vertCount:(NSUInteger)vertCount center:(PMVect)center;
- (void)setVertices:(PMVect[])vertices vertCount:(NSUInteger)vertCount;


#pragma mark -
#pragma mark Other Methods
+ (BOOL)validateVertices:(PMVect[])vertices vertCount:(NSUInteger)vertCount;

@end
